[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
eval(EXPR)
eval EXPR
EXPR is parsed and executed as if it were a little
perl program. It is executed in the context of the
current perl program, so that any variable settings,
subroutine or format definitions remain afterwards.
The value returned is the value of the last expres-
sion evaluated, just as with subroutines. If there
is a syntax error or runtime error, or a die state-
ment is executed, an undefined value is returned by
eval, and $@ is set to the error message. If there
was no error, $@ is guaranteed to be a null string.
If EXPR is omitted, evaluates $_. The final semi-
colon, if any, may be omitted from the expression.
Note that, since eval traps otherwise-fatal errors,
it is useful for determining whether a particular
feature (such as dbmopen or symlink) is implemented.
It is also Perl's exception trapping mechanism,
where the die operator is used to raise exceptions.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson